package com.heima.exception;

public enum ErrorCode {
    USER_NOT_FOUND(401, "用户不存在"),
    PASSWORD_ERROR(402, "密码错误"),
    UNAUTHORIZED(403, "未登录或缺少token"),
    TOKEN_INVALID(403, "token无效或已过期"),
    // 可扩展其他业务异常
    SYSTEM_ERROR(500, "系统异常");

    private final int code;
    private final String message;

    ErrorCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
